import { fromJS } from 'immutable'
import * as constants from './constants'

const defaultState = fromJS({
  title: '有没有什么很棒的朋友圈文案？',
  content: '<img alt="" src="https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=4189601852,4264472451&fm=15&gp=0.jpg" /><p>1.你是落日弥漫的橘 是天边透亮的星</p><p>2.按照大自然的规律你该遇到我了</p><p>3.但愿那些不为人知的你 都有被好好珍藏</p><p>4.月色暗淡还有星辰 山河失色你还有我</p><p>5.你终会是一个人宇宙限量贩售的快乐</p>'
})
// eslint-disable-next-line import/no-anonymous-default-export
export default (state = defaultState, action) => {
  switch (action.type) {
    case constants.DETAIL_DATE:
      return state.merge({
        title: action.title,
        content: action.content
      })
    default:
      return state
  }
}